/**
 * Copyright (c) 2017 ShopJsp. All Rights Reserved.
 * ============================================================================
 * 版权所有 2011 - 今 北京华宇盈通科技有限公司，并保留所有权利。
 * ----------------------------------------------------------------------------
 * 提示：在未取得SHOPJSP商业授权之前，您不能将本软件应用于商业用途，否则SHOPJSP将保留追究的权力。
 * ----------------------------------------------------------------------------
 * 官方网站：http://www.shopjsp.com
 * ============================================================================
 * @author 张丁方
 * @CreateTime 2017-4-6 17:28:19
 */
package com.hyyt.shopjsp.share.service.imp;

import com.hyyt.shopjsp.share.dao.ShopShareRegisterDAO;
import com.hyyt.shopjsp.share.pojo.ShopShareRegister;
import com.hyyt.shopjsp.share.service.IShopShareRegisterService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import org.apache.log4j.Logger;

@Service
public class ShopShareRegisterService implements IShopShareRegisterService {
    private static final Logger logger = Logger.getLogger(IShopShareRegisterService.class);

    @Resource
    private ShopShareRegisterDAO shopShareRegisterDAO;

    /**
     * 保存SHOP_分享注册
     *
     * @param shopShareRegister SHOP_分享注册
     * @return 保存后的SHOP_分享注册
     */
    @Override
    public void saveShopShareRegister(ShopShareRegister shopShareRegister) {
        shopShareRegisterDAO.insert(shopShareRegister);
    }

    /**
     * 更新SHOP_分享注册
     *
     * @param shopShareRegister SHOP_分享注册
     * @return 更新后的SHOP_分享注册
     */
    @Override
    public void updateShopShareRegister(ShopShareRegister shopShareRegister) {
        shopShareRegisterDAO.update(shopShareRegister);
    }

    /**
     * 删除指定ID的SHOP_分享注册
     *
     * @param id SHOP_分享注册ID
     */
    @Override
    public void deleteShopShareRegister(Integer id) {
        shopShareRegisterDAO.delete(id);
    }

    /**
     * 删除指定ID集合的SHOP_分享注册
     *
     * @param ids SHOP_分享注册ID集合
     */
    @Override
    public void deleteShopShareRegister(Collection<Integer> ids){
        shopShareRegisterDAO.batchDelete(ids);
    }

    /**
     * 根据ID加载一个SHOP_分享注册
     *
     * @param id SHOP_分享注册ID
     * @return SHOP_分享注册
     */
    @Override
    public ShopShareRegister loadShopShareRegister(Integer id) {
        return shopShareRegisterDAO.load(id);
    }

    /**
     * 查询所有的SHOP_分享注册，通常有最多取30000条记录的限制
     *
     * @return 所有的SHOP_分享注册，通常有最多取30000条记录的限制
     */
    @Override
    public List<ShopShareRegister> queryAllShopShareRegister() {
        return shopShareRegisterDAO.queryAll();
    }

    /**
     * 查询SHOP_分享注册
     *
     * @param params 查询参数，为key-value形式
     * @return SHOP_分享注册集合
     */
    @Override
    public List<ShopShareRegister> queryShopShareRegister(Map<String, Object> params) {
        return shopShareRegisterDAO.query(params);
    }

    /**
     * 查询SHOP_分享注册
     *
     * @param params   查询参数，没有则传null,分页参数key为“sortColumns”
     * @param startRow 起始行数（不含起始行的数据）
     * @param rowSize  要查询记录数
     * @return SHOP_分享注册集合
     */
    @Override
    public List<ShopShareRegister> queryShopShareRegister(Map<String, Object> params, int startRow, int rowSize) {
        return shopShareRegisterDAO.query(params, startRow, rowSize);
    }

    /**
     * 统计SHOP_分享注册
     *
     * @param params 查询参数，没有则传null,分页参数key为“sortColumns”
     * @return 结果集记录数
     */
    @Override
    public int countShopShareRegister(Map<String, Object> params) {
        return shopShareRegisterDAO.count(params);
    }
}